<form method="POST">
	<table cellpadding="5" cellspacing="0" border="1" bordercolor="#FFFFFF" class="art-article" style="width:97%; border-color:#F60">
		<tr style="background-color:#FC6; color:#900">
			<th>Id</th>
			<th>Name</th>
			<th>Price</th>
			<th>Discount</th>
			<th>Quantity</th>
			<th>Amount</th>
			<th>&nbsp;</th>
		</tr>
	<?php // thong ke thong tin
		$GioHang = $_SESSION['GioHang'];    
	    $TongTien = 0;
	    foreach($GioHang as $MaHH=>$MatHang)
		{
			$MaHH = $MatHang['MaHH'];
			$TenHH = $MatHang['TenHH'];
			$DonGia = $MatHang['DonGia'];
			$GiamGia = $MatHang['GiamGia']*100;
			$SoLuong = $MatHang['SoLuong'];
			$ThanhTien = $DonGia*$SoLuong*(1-$GiamGia);
			$TongTien += $ThanhTien;
			echo "
			<tr>
				<td>$MaHH</td>
				<td>$TenHH</td>
				<td>$$DonGia</td>
				<td>$GiamGia%</td>
				<td><input name='qty_$MaHH' value='$SoLuong' style='width:30px'/></td>
				<td>$$ThanhTien</td>
				<td><a href='?p=ShoppingCart&btnRemoveFromCart=$MaHH'>
					<img src='Hinh/icons/Remove from basket.png'></a></td>
			</tr>
			";
		}
		
		$btnCheckoutStatus = (count($GioHang) > 0 && isset($_SESSION['KhachHang']))? "" : "disabled";
	?>
		<tr>
			<th colspan="5" style="text-align:right">Total amount: </th>
			<th>$<?php echo $TongTien?></th>
			<th>&nbsp;</th>
		</tr>
		<tr>
			<th colspan="7" align="center">
				<input name='btnUpdateCart' value='Update' type="submit" class="art-button"/>
				<input name='btnClearCart' value='Clear' type="submit" class="art-button"/>
				<input onclick="location.href='index.php?p=ProductList'" name='btnContinue' value='Continue' type="button" class="art-button"/>
				<input <?php echo $btnCheckoutStatus?> onclick="location.href='index.php?p=Checkout'" name='btnCheckout' value='Checkout' type="button" class="art-button"/>
			</th>
		</tr>
	</table>
</form>